use crate::mir::{basicblock, mir_ref::BasicBlockRef};
use super::mtype::MIRType;
use derive_new::new;


#[derive(Debug)]
pub struct func {
    pub func_name: String,
    pub func_ret_ty: MIRType,
    pub func_f_params: Vec<(String, MIRType)>,
    pub bbs: Vec<BasicBlockRef>,
}

impl func {
    pub fn new(func_name: String, 
               func_ret_ty: MIRType,
               func_f_params: Vec<(String, MIRType)>,
               ) -> Self {
        Self {
            func_name: func_name,
            func_ret_ty: func_ret_ty,
            func_f_params: func_f_params,
            bbs: Vec::new(),
        }
    }

    pub fn add_bb(&mut self, bb_ref: BasicBlockRef) {
        self.bbs.push(bb_ref);
    }
}



